<?php
// Module Definition
$module['name'] = 'Custom Logo';
$module['description'] = 'Allows server admin and resellers to upload their logo for the control panel.';

switch($action) {
	case 'register':
		break;
	case 'unregister':
		global $cfg;
		$dirlocation = $cfg['basedir'].'/web/skin/_logomod';
		if (is_dir($dirlocation)) {
			if (!rm($dirlocation)) {
				webcp_log(1,0,'logo-mod',"Could not delete directory: ".$cfg['basedir'].'/web/skin/_logomod',0,false);
			}
			
		}
		$SQL = 'DELETE FROM properties WHERE user = "logo_mod" and name = "logo"';
		mysql_query($SQL);
		break;
	case 'enable':
		global $cfg;
		$dirlocation = $cfg['basedir'].'/web/skin/_logomod';
		if (!is_dir($dirlocation)) {
			if (!mkdir($dirlocation)) {
				webcp_log(1,0,'logo-mod',"Could not create directory: ".$cfg['basedir'].'/web/skin/_logomod',0,false);
			}
		}
		break;
	case 'disable':
		break;
	case 'hook':
		register_hook('web:cfg:default', 'logo_add_cfg');
		register_hook('web:menu', 'logo_add_menu');
		register_hook('web:lang', 'logo_add_lang');
		register_hook('web:parser', 'logo_parser_add_class');
		register_hook('web:reseller:customlogo', 'logo_upload_reseller_image');
		register_hook('web:server:customlogo', 'logo_upload_server_image');
		break;
}
?>